const App = getApp()
Page({
	data: {
		userInfo: {},
		items: [
			{
				icon: '../../images/iconfont-order.png',
				text: '添加学生绑定',
        path: '/pages/register/register'
			}, 
      {
        icon: '../../assets/images/iconfont-user-active.png',
        text: '切换学生登录',
        path: '/pages/qhdl/qhdl'
      },
      {
        icon: '../../assets/images/iconfont-about.png',
        text: '修改我的信息', 
        path: '/pages/editinfo/editinfo'
      },
      {
        icon: '../../assets/images/iconfont-help.png',
        text: '我报名过的辅导班',
        path: '/pages/order/list/index'
      }
		],
    grzx: App.myUlife.ulifeUrl + '/wx/grzx.jpg',
    ulifeUrl: App.myUlife.ulifeUrl
	},
    onLoad: function() {
      var that = this;
      var openid = wx.getStorageSync('openid');
   
      if (openid == "") {
        wx.redirectTo({
          url: '../../pages/index/index'
        })
      } else {
        var userInfo= { 
          city: wx.getStorageSync('city'),
          province: wx.getStorageSync('province'),
          gender: wx.getStorageSync('gender'),
          nickName: wx.getStorageSync('nickName'),
          avatarUrl: wx.getStorageSync('avatarUrl'),
          openid : wx.getStorageSync('openid')
        }
        that.setData({
          userInfo: userInfo
        });
      } 
	},
  
	navigateTo(e) {
		const path = e.currentTarget.dataset.path
			wx.navigateTo({
        url: path,
      })
    },
	
    bindtap(e) {
      const path = e.currentTarget.dataset.path
      wx.navigateTo({
        url: path,
      })
    },
    //退出登录
    exitlogin: function(){
      
      wx.redirectTo({
        url: '../../pages/index/index'
      })
    }

})